Optimal. Leaf size=42 \[ \frac {\sqrt {1+\frac {b \cos ^2(x)}{a}} F\left (\frac {\pi }{2}+x|-\frac {b}{a}\right )}{\sqrt {a+b \cos ^2(x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3262, 3261}
\begin {gather*} \frac {\sqrt {\frac {b \cos ^2(x)}{a}+1} F\left (x+\frac {\pi }{2}|-\frac {b}{a}\right )}{\sqrt {a+b \cos ^2(x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3261
Rule 3262
Rubi steps
\begin {align*} \int \frac {1}{\sqrt {a+b \cos ^2(x)}} \, dx &=\frac {\sqrt {1+\frac {b \cos ^2(x)}{a}} \int \frac {1}{\sqrt {1+\frac {b \cos ^2(x)}{a}}} \, dx}{\sqrt {a+b \cos ^2(x)}}\\ &=\frac {\sqrt {1+\frac {b \cos ^2(x)}{a}} F\left (\frac {\pi }{2}+x|-\frac {b}{a}\right )}{\sqrt {a+b \cos ^2(x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.07, size = 46, normalized size = 1.10 \begin {gather*} \frac {\sqrt {\frac {2 a+b+b \cos (2 x)}{a+b}} F\left (x\left |\frac {b}{a+b}\right .\right )}{\sqrt {2 a+b+b \cos (2 x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.27, size = 48, normalized size = 1.14
method | result | size |
default | \(-\frac {\sqrt {\frac {1}{2}-\frac {\cos \left (2 x \right )}{2}}\, \sqrt {\frac {a +b \left (\cos ^{2}\left (x \right )\right )}{a}}\, \EllipticF \left (\cos \left (x \right ), \sqrt {-\frac {b}{a}}\right )}{\sin \left (x \right ) \sqrt {a +b \left (\cos ^{2}\left (x \right )\right )}}\) | \(48\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [C] Result contains complex when optimal does not.
time = 0.10, size = 276, normalized size = 6.57 \begin {gather*} -\frac {{\left (-2 i \, b \sqrt {\frac {a^{2} + a b}{b^{2}}} - 2 i \, a - i \, b\right )} \sqrt {b} \sqrt {\frac {2 \, b \sqrt {\frac {a^{2} + a b}{b^{2}}} - 2 \, a - b}{b}} F(\arcsin \left (\sqrt {\frac {2 \, b \sqrt {\frac {a^{2} + a b}{b^{2}}} - 2 \, a - b}{b}} {\left (\cos \left (x\right ) + i \, \sin \left (x\right )\right )}\right )\,|\,\frac {8 \, a^{2} + 8 \, a b + b^{2} + 4 \, {\left (2 \, a b + b^{2}\right )} \sqrt {\frac {a^{2} + a b}{b^{2}}}}{b^{2}}) + {\left (2 i \, b \sqrt {\frac {a^{2} + a b}{b^{2}}} + 2 i \, a + i \, b\right )} \sqrt {b} \sqrt {\frac {2 \, b \sqrt {\frac {a^{2} + a b}{b^{2}}} - 2 \, a - b}{b}} F(\arcsin \left (\sqrt {\frac {2 \, b \sqrt {\frac {a^{2} + a b}{b^{2}}} - 2 \, a - b}{b}} {\left (\cos \left (x\right ) - i \, \sin \left (x\right )\right )}\right )\,|\,\frac {8 \, a^{2} + 8 \, a b + b^{2} + 4 \, {\left (2 \, a b + b^{2}\right )} \sqrt {\frac {a^{2} + a b}{b^{2}}}}{b^{2}})}{b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {1}{\sqrt {a + b \cos ^{2}{\left (x \right )}}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \frac {1}{\sqrt {b\,{\cos \left (x\right )}^2+a}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________